const debug = process.env.NODE_ENV !== "production";

const BATCH_TYPES = {
  BATCH_RECEIPT_ID: 'BATCH_RECEIPT_ID',
  BATCH_BIND_ID: 'BATCH_BIND_ID'
};

const state = {
  batchReceiptId: null,
  batchBindId: null
};
const getters = {};

const mutations = {
  [BATCH_TYPES.BATCH_RECEIPT_ID] (state, batchReceiptId) {
    state.batchReceiptId = batchReceiptId;
  },
  [BATCH_TYPES.BATCH_BIND_ID] (state, batchBindId) {
    state.batchBindId = batchBindId;
  },
};

const actions = {
  async setBatchReceiptId ({ commit }, data) {
    commit(BATCH_TYPES.BATCH_RECEIPT_ID, data);
  },
  async setbatchBindId ({ commit }, data) {
    commit(BATCH_TYPES.BATCH_BIND_ID, data);
  },
};

export default {
  strict: debug,
  namespaced: true,
  state,
  getters,
  mutations,
  actions
};
